<?php 
require_once('Connections/tecno.php'); 
session_start();
include('scripts/fechaMysqlNormal.php');
$id = "-1";
if (isset($_REQUEST['id'])) {
  $id = $_REQUEST['id'];
}
mysql_select_db($database_tecno, $tecno);
$query_prod = "SELECT * FROM datospersonales WHERE id = $id";
$prod = mysql_query($query_prod, $tecno) or die(mysql_error());
$row_prod = mysql_fetch_assoc($prod);
$totalRows_prod = mysql_num_rows($prod);
?>
<link href="css/styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.4.2.js"></script>
<link type="text/css" href="js/themes/base/ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="js/ui/ui.core.js"></script>
	<script type="text/javascript" src="js/ui/ui.tabs.js"></script>
	<link type="text/css" href="../demos.css" rel="stylesheet" />

<script type="text/javascript">
$(document).ready(function(){
//Para ver el detalle del financiamiento del producto
$("#product").change (function(){
		$("#cargando").css("display","inline");
		$.post('det_producto.php', $("#pres").serialize(),function(data){
			$('#mensaje').html(data);		
			$("#cargando").css("display", "none");
		})
	});
//Para Guardar un pago de producto
$("#guardar").click(function(){
		$("#cargando").css("display","inline");
		$.post('arrayPago.php', $("#prod").serialize(),function(data){
			$('#mensaje').html(data);		
			$("#cargando").css("display", "none");
		})
	});
//Para Guardar un pago de prestamo
$("#guardarP").click(function(){
		$("#cargandoP").css("display","inline");
		$.post('arrayPago.php', $("#pres").serialize(),function(data){
			$('#mensajeP').html(data);		
			$("#cargandoP").css("display", "none");
		})
	});

});
</script>
<script type="text/javascript">
	$(function() {
		$("#tabs").tabs();
	});
	</script>

<div id="right" style="float:none;margin:0px;height:440px;width:750px;">
    <!--inicio div content-right -->
    <div id="content-right">
      <h2 style="text-align:center">Pagos</h2>
      <div class="form">
       	<h3 style="text-align:center;"><span style=" font-size:15px; font-weight:bold;">Cliente:</span>
        	  <?php echo $row_prod['cedula']." - ".$row_prod['primerApellido'].", ".$row_prod['nombres'];;?>
          <img src="images/iconos/Select.png" width="24" height="24" alt="Pagada" />Pagada  <img src="images/iconos/Alert.png" width="24" height="24" alt="Vencida" /> Abonada  <img src="images/iconos/Stop.png" width="24" height="24" alt="Vencida" /> Vencida</h3>
   <div class="demo">

<div id="tabs">
	<ul>
		<li><a href="#tabs-1">Productos</a></li>
		<li><a href="#tabs-2">Prestamo</a></li>
		<li><a href="#tabs-3">Hist&oacute;rico</a></li>
	</ul>
	<div id="tabs-1">
    <div>
    <?php include('sql_det_prod.php'); ?>
<form id="prod" name="prod" action="#">
 <fieldset>
           <legend>Pago Producto</legend>
                <table width="612" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="67">Producto:</td>
                    <td width="134">
                      <select name="product" class="input-med" id="product">
                        <option value="0">Seleccione</option>
			    <?php do {  ?>
                        <option value="<?php echo $row_det_prod['idArt']; ?>"><?php echo $row_det_prod['productoDes']; ?></option>
    <?php } while ($row_det_prod = mysql_fetch_assoc($det_prod)); ?>
                      </select>
</td>
                    <td width="48">Fecha:</td>
                    <td width="129"><input type="text" name="fecha" id="fecha" style="margin-left:5px;" class="input-med" value="<?php echo date("d/m/y"); ?>" /></td>
                    <td width="51">Monto: </td>
                    <td width="183"><input type="text" id="monto" name="monto"style="margin-left:5px;" class="input-peq" />
                    <input name="cedula" type="hidden" id="cedula" value="<?php echo $row_prod['cedula']; ?>" />
                    <input name="tipo" type="hidden" id="tipo" value="1" /></td>
                  </tr>
                  <tr>
                    <td>Forma:</td>
                    <td><select name="forma" class="input-med" id="forma">
                      <option value="Efectivo" selected="selected">Efectivo</option>
                      <option value="Cheque">Cheque</option>
                      <option value="Deposito">Dep&oacute;sito</option>
                      <option value="Transferencia">Transferencia</option>
                    </select></td>
                    <td>Nro</td>
                    <td><input type="text" id="nro" name="nro" class="input-med" style="margin-left:5px;" /></td>
                    <td colspan="2">
                    <a href="#">
                <div id="guardar" class="botonCustom" style="float:left;">Guardar</div>
          </a>
</td>
                  </tr>
                </table>
 </fieldset>
</form>
       </div>
      <div id="cargando" style="display:none; top:15px; position:relative; z-index:1000; margin-left:350px;">
            <img src="images/loading.gif" />	
          </div>
          <div class="clear"></div>
          <div id="mensaje" style="overflow:auto; width:580px; height:130px; margin-left:10px; left: 120px; top: 278px;"></div>
</div>
<div id="tabs-2">
    <?php include('sql_det_pres.php'); ?>
<form id="pres" name="pres" action="#">
 <fieldset>
           <legend>Pago Prestamo</legend>
                <table width="612" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="67">Producto:</td>
                    <td width="134">
                      <select name="prestamo" class="input-med" id="prestamo">
                        <option value="0">Seleccione</option>
			    <?php do {  ?>
                        <option value="<?php echo $row_det_pres['idArt']; ?>"><?php echo $row_det_pres['productoDes']; ?></option>
    <?php } while ($row_det_pres = mysql_fetch_assoc($det_pres)); ?>
                      </select>
</td>
                    <td width="48">Fecha:</td>
                    <td width="129"><input type="text" name="fecha" id="fecha" style="margin-left:5px;" class="input-med" value="<?php echo date("d/m/y"); ?>" /></td>
                    <td width="51">Monto: </td>
                    <td width="183"><input type="text" id="monto" name="monto"style="margin-left:5px;" class="input-peq" />
                    <input name="cedula" type="hidden" id="cedula" value="<?php echo $row_prod['cedula']; ?>" />
                    <input name="tipo" type="hidden" id="tipo" value="2" /></td>
                  </tr>
                  <tr>
                    <td>Forma:</td>
                    <td><select name="forma" class="input-med" id="forma">
                      <option value="Efectivo" selected="selected">Efectivo</option>
                      <option value="Cheque">Cheque</option>
                      <option value="Deposito">Dep&oacute;sito</option>
                      <option value="Transferencia">Transferencia</option>
                    </select></td>
                    <td>Nro</td>
                    <td><input type="text" id="nro" name="nro" class="input-med" style="margin-left:5px;" /></td>
                    <td colspan="2">
                    <a href="#">
                <div id="guardarP" class="botonCustom" style="float:left;">Guardar</div>
          </a>
</td>
                  </tr>
                </table>
 </fieldset>
</form>
      <div id="cargandoP" style="display:none; top:15px; position:relative; z-index:1000; margin-left:350px;">
            <img src="images/loading.gif" />	
          </div>
          <div class="clear"></div>
          <div id="mensajeP" style="overflow:auto; width:580px; height:130px; margin-left:10px; left: 120px; top: 278px;">
          
</div>
	</div>
	<div id="tabs-3">
		<p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p>
		<p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p>
	</div>
</div>

</div><!-- End demo -->                   
</div>
    <!--fin div content-right -->
</div>
